import http from "@/common/http/request";
import {
  musicSongFileListInterface,
  musicSongFileAddInterface,
  musicSongFileUpdateInterface,
} from "./songFile.interface";

// 曲谱文件记录列表
export const $musicSongFileList = (data: musicSongFileListInterface) => {
  const $http = new http();
  return $http.get({
    url: '/music/songFile/list',
    data,
  })
}

// 曲谱文件记录详情
export const $musicSongFileDetail = (id: number) => {
  const $http = new http();
  return $http.get({
    url: `/music/songFile/${id}`,
  })
}

// 新增曲谱文件记录
export const $musicSongFileAdd = (data: musicSongFileAddInterface) => {
  const $http = new http();
  return $http.post({
    url: '/music/songFile',
    data,
  })
}

// 修改曲谱文件记录
export const $musicSongFileUpdate = (data: musicSongFileUpdateInterface) => {
  const $http = new http();
  return $http.put({
    url: '/music/songFile',
    data,
  })
}

// 删除曲谱文件记录
export const $musicSongFileDelete = (data: Array<string>) => {
  const $http = new http();
  return $http.delete({
    url: `/music/songFile/${data.join(',')}`,
  })
}